<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:composite="http://java.sun.com/jsf/composite"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.org/ui"
	xmlns:c="http://java.sun.com/jsp/jstl/core">


<composite:interface>
	<composite:attribute name="title" />
</composite:interface>

<composite:implementation>
	<p:panel id="UserPanel">
		<c:if test="#{userBean.activeUser!=null}">
			<h:form id="showUserProfile">
	
				<p:tab id="profileData" title="#{userBean.profileData.lastName}">
	
					<p:panelGrid columns="2" cellpadding="10">
						<h:outputText value="Benutzername: " />
						<h:outputText id="userName"
							value="#{userBean.profileData.username}" style="font-weight: bold" />
						
						<h:outputText value="Profilbild: " />	
					    <p:graphicImage value="#{userBean.profileImage}" width="80" heigth="120" /> 
	
						<h:outputText value="Vorname:" />
						<h:outputText id="firstName"
							value="#{userBean.profileData.firstName}"
							style="font-weight: bold" />
	
						<h:outputText value="Nachname:" />
						<h:outputText id="surName" value="#{userBean.profileData.lastName}"
							style="font-weight: bold" />
	
						<h:outputText value="Ort:" />
						<h:outputText id="city" value="#{userBean.profileData.city}"
							style="font-weight: bold" />
	
						<h:outputText value="Abteilung:" />
						<h:outputText id="department"
							value="#{userBean.profileData.department.name}"
							style="font-weight: bold" />
	
						<h:outputText value="Mail:" />
						<h:outputText id="email" value="#{userBean.profileData.email}"
							style="font-weight: bold" />
	
						<h:outputText value="Raum:" />
						<h:outputText id="roomNumber"
							value="#{userBean.profileData.roomNumber}"
							style="font-weight: bold" />
	
						<h:outputText value="Telefon:" />
						<p:inputText id="telephone"
							value="#{userBean.profileData.telephone}"
							style="font-weight: bold" />
	
						<h:outputText value="Interessen:" />
						<p:inputTextarea id="interests"
							value="#{userBean.profileData.interests}"
							style="font-weight: bold" />
	
						<h:outputText value="Expertisen:" />
						<p:inputTextarea id="expertise"
							value="#{userBean.profileData.expertise}"
							style="font-weight: bold" />
	
					</p:panelGrid>
					<p:commandButton id="saveUserButton" actionListener="#{userController.updateUser}"
						value="Speichern" icon="ui-icon-disk" ajax="false" />
	
				</p:tab>
	
			</h:form>
			<h:form enctype="multipart/form-data" id="multipartForm" >
	
				<p:fileUpload fileUploadListener="#{fileUploadController.uploadUserProfileImage}"
				 allowTypes="/(\.|\/)(jpg|JPG|jpeg|JPEG)$/" sizeLimit="1000000" description="Select Images"/>
	
			</h:form>
		</c:if>
	</p:panel>
</composite:implementation>
</html>